﻿using PoemGame.ComputerAnswer.Shared;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PoemGame.ComputerAnswer.Xml
{
    public class ComputerAnswerFeihualing : ComputerAnswerBase, IComputerAnswer
    {
        public ComputerAnswerFeihualing() : base()
        {

        }
        public string Answer(string gamecontext,string lastanswer)
        {
            var rows=poemlinedt.Select("LineContent like '%" +gamecontext + "%'");
            if (rows.Count() > 0)
            {
                var rnd = new Random();
                var idx=rnd.Next(rows.Count());
                return rows[idx]["LineContent"].ToString();
                
            }
            return "";
        }
    }
}
